[18.0][FIX] document_page: Don't change last history name and summary…#565
[18.0][FIX] document_page: Don't change last history name and summary…#565
Conversation
… when creating new revision of page. Fixes an issue where editing a document.page and changing name and/or summary (to create a new revision) also changes name and summary of the history_head. draft_name and draft_summary are now computed fields (based on history_head) but have set the inverse without actually setting the value, to allow setting them when creating a new draft page. The issue is prominently evident when using document_page_approval where the name/summary for the new draft also change the last approved version (aka history_head) which should not happen.
pedrobaeza
left a comment
There was a problem hiding this comment.
But with this, you cannot change the head name and summary...
etobella
left a comment
There was a problem hiding this comment.
IT is not working....
If you write only one of the fields, the other are resetted...
In fact you can, because we set inverse on the field (even though not doing anything about it in the inverse method). If there is a history_head, then these are fetched along with content, otherwise they are kept empty. This way we always have the correct name and summary from history head, but allows to change them if we change the content |
That is how I made it work. However, especially in ISO certifications related documentation, having a document history with the same version and / or summary is wrong. |
|
Yes, I know, however, this might give errors latelly. The don't changed are lost, and that is not an option. |
|
Sorry, can't quite understand what you mean. Can you please explain further? |
… when
creating new revision of page.
Fixes an issue where editing a document.page and changing name and/or summary (to create a new revision) also changes name and summary of the history_head.
draft_name and draft_summary are now computed fields (based on history_head) but have set the inverse without actually setting the value, to allow setting them when creating a new draft page.
The issue is prominently evident when using document_page_approval where the name/summary for the new draft also change the last approved version (aka history_head) which should not happen.